package com.ujoku.domain;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.labillusion.core.util.jsonFormat.SimpleDateSerializer;
import com.labillusion.core.util.jsonFormat.SimpleDateTimeSerializer;

import java.util.Date;

/**
 * Created by Greg.Chen on 2015/2/7.
 */
public class MemberBalanceLog {
    private String id;
    private Integer memberId;
    private String memberName;
    private Integer type;
    private String typeName;
    private Double amount;
    private String bank;
    private String account;
    private String accountName;
    private String tradeNo;
    private Integer status;
    private String statusName;

    @JsonSerialize(using = SimpleDateTimeSerializer.class)
    private Date addTime;
    private String cancelReason;

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public String getTypeName() {
        if(type == MemberBalanceLogType.RECHARGE)
            return "充值";
        if(type == MemberBalanceLogType.WITHDRAW)
            return "提现";

        return null;
    }

    public String getStatusName() {
        if(status == MemberBalanceLogStatus.CREATED)
            return "创建";
        if(status == MemberBalanceLogStatus.DONE)
            return "成功";
        if(status == MemberBalanceLogStatus.CANCEL)
            return "取消";

        return null;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public Integer getMemberId() {
        return memberId;
    }

    public void setMemberId(Integer memberId) {
        this.memberId = memberId;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public String getBank() {
        return bank;
    }

    public void setBank(String bank) {
        this.bank = bank;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCancelReason() {
        return cancelReason;
    }

    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }
}
